package code;

public abstract class MovableObject
{
	private ContainerCell containerCell;
	private String texture;
	
	public MovableObject(String texture){
		this.texture = texture;
		
	}

	public String PRINT(){
		return texture;
	}
	public void setCell(ContainerCell containerCell)
	{
		this.containerCell = containerCell;
	}
	
	public abstract Boolean attemptMove(Direction dir);
	
	public ContainerCell getCurrentCell()
	{
		return containerCell;
	}
	
	public boolean canMove(Direction dir)
	{
		Cell aux = this.getCurrentCell();
		return aux.cellAt(dir).isEmpty();
	}
	
	public void moveTo(ContainerCell target)
	{
		target.placeObject(this.containerCell.takeObject());
	}
	
	public boolean sinksOnWater(){
		return false;
	}
	
	public  void  eraseSelf(){
		this.getCurrentCell().takeObject();
	}
	
	public void isOnWater()
	{
		this.eraseSelf();
		
	}
	
	public boolean activatesSwitch(){
		return false;
	}
	
	public boolean activatesGoal(){
		return false;
	}
}
	
